// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_HR_AGENT
// * CreateDate    : 2011/10/27 13:18:50
// * Creater       : CodeSmith
// * LastChangeDate: 2011/10/27 13:18:50
// * LastChanger   : 2011/10/27 13:18:50
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Hr
{
/// <summary>
    /// HrAgent
    /// </summary>
    public partial class HrAgentBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objHrAgentEntity">Entity</param>
        /// <returns>Entity</returns>
        public static HrAgentEntity GetHrAgent(HrAgentEntity objHrAgentEntity)
        {
            return DataAccess.SelectSingle<HrAgentEntity>(objHrAgentEntity);
        }

        public static HrAgentEntity GetHrAgentByPerson(string personId)
        {
            if (string.IsNullOrEmpty(personId))
            {
                return null;
            }
            HrAgentEntity entity = new HrAgentEntity();
            entity.PersonId = personId;
            return DataAccess.SelectSingle<HrAgentEntity>(entity);
        }

        public static List<HrAgentEntity> GetHrAgentByAgent(string agentId)
        {
            if (string.IsNullOrEmpty(agentId))
            {
                return null;
            }
            HrAgentEntity entity = new HrAgentEntity();
            entity.PersonId = agentId;
            return DataAccess.Select<HrAgentEntity>(entity);
        }
        #endregion

        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objHrAgentEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertHrAgent(HrAgentEntity objHrAgentEntity)
        {
            return DataAccess.Insert(objHrAgentEntity);
        }

        public static bool InsertHrAgent(List<HrAgentEntity> objHrAgentEntityList)
        {
            return DataAccess.Insert(objHrAgentEntityList);
        }
        #endregion

        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objHrAgentEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateHrAgent(HrAgentEntity objHrAgentEntity)
        {
            return DataAccess.Update(objHrAgentEntity);
        }

        public static bool UpdateHrAgent(List<HrAgentEntity> objHrAgentEntityList)
        {
            return DataAccess.Update<HrAgentEntity>(objHrAgentEntityList);
        }
        #endregion

        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objHrAgentEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteHrAgent(HrAgentEntity objHrAgentEntity)
        {
            return DataAccess.Delete(objHrAgentEntity);
        }

        public static bool DeleteHrAgent(List<HrAgentEntity> objHrAgentEntityList)
        {
            return DataAccess.Delete<HrAgentEntity>(objHrAgentEntityList);
        }
        #endregion

        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetHrAgentAll()
        {
            return DataAccess.SelectAllDataSet<HrAgentEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<HrAgentEntity> GetHrAgentAllList()
        {
            return DataAccess.SelectAll<HrAgentEntity>();
        }
        #endregion
	}
	
	
}	

